﻿<%@ Page Title="" Language="C#" MasterPageFile="~/App_MasterPages/Aquarius.Master"
    AutoEventWireup="true" CodeBehind="StaffManagement.aspx.cs" Inherits="PanasonicWarranty.UI.StaffManagement" %>

<%@ Register Src="UserControl/ucPaging.ascx" TagName="ucPaging" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CssContent" runat="server">
    <style type="text/css">
        .block-fluid p span
        {
            width: 85px;
            display: inline-block;
            padding-left: 10px;
            vertical-align: middle;
        }
        .block-fluid p
        {
            margin-bottom: -2px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ScriptContent" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            registerScript();
        });

        function registerScript() {
            $("#<%=txtDOB.ClientID%>").datepicker();
            $("#<%=txtPhoneNumber.ClientID%>").tooltip();
        }
    </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <asp:UpdatePanel ID="udpn" runat="server">
        <ContentTemplate>
            <div class="row-fluid">
                <div class="span12">
                    <div class="head">
                        <div class="isw-grid">
                        </div>
                        <h1>
                            Staff details</h1>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="block-fluid" style="padding: 5px">
                        <div style="width: 640px">
                            <asp:HiddenField ID="hdfStaffID" runat="server" />
                            <asp:HiddenField ID="hdfAction" runat="server" />
                            <p>
                                <span>Staff Code</span>
                                <asp:TextBox ID="txtStaffCode" runat="server" />
                                <span>Staff Name</span>
                                <asp:TextBox ID="txtStaffName" runat="server" />
                            </p>
                            <p>
                                <span>Date of birth</span>
                                <asp:TextBox ID="txtDOB" runat="server" />
                                <span>Gender</span>
                                <asp:DropDownList ID="drdGender" runat="server">
                                    <asp:ListItem Value="true">Male</asp:ListItem>
                                    <asp:ListItem Value="false">Female</asp:ListItem>
                                </asp:DropDownList>
                            </p>
                            <p>
                                <span>Staff type</span>
                                <asp:DropDownList ID="drdStaffType" runat="server" />
                                <span>Staff level</span>
                                <asp:DropDownList ID="drdStaffLevel" runat="server" />
                            </p>
                            <p>
                                <span>Unit</span>
                                <asp:DropDownList ID="drdUnit" runat="server" />
                                <span>Status</span>
                                <asp:DropDownList ID="drdStatus" runat="server">
                                    <asp:ListItem Value="true">Active</asp:ListItem>
                                    <asp:ListItem Value="false">Deactive</asp:ListItem>
                                </asp:DropDownList>
                            </p>
                            <p>
                                <span>Phone number</span>
                                <asp:TextBox ID="txtPhoneNumber" runat="server" TextMode="MultiLine" Rows="2" onkeypress="javascript:return ValidateKeypress(/[\d,]/,event);"
                                    ToolTip="Enter multiple phone number, each separator by ',' symbol" />
                                <span>Address</span>
                                <asp:TextBox ID="txtAddress" runat="server" TextMode="MultiLine" Rows="2" />
                            </p>
                            <p style="text-align: right">
                                <asp:Button ID="btnCancel" runat="server" CssClass="btn" Text="Cancel" OnClick="btnCancel_Click" />
                                &nbsp;
                                <asp:Button ID="btnOK" runat="server" CssClass="btn" Text="OK" Style="width: 70px"
                                    OnClick="btnOK_Click" />
                            </p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row-fluid">
                <div class="span12">
                    <div class="head">
                        <div class="isw-list">
                        </div>
                        <h1>
                            List Of Staff</h1>
                        <ul class="buttons">
                            <li>
                                <asp:LinkButton ID="lbtnAddNew" runat="server" CssClass="isw-plus" ToolTip="Add new Staff"
                                    runat="server" OnClick="lbtnAddNew_Click" />
                            </li>
                        </ul>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="block-fluid  table-sorting">
                        <div role="grid" class="dataTables_wrapper" id="tSortable_wrapper">
                            <div id="tSortable_length" class="dataTables_length">
                                <label>
                                    Show
                                    <asp:DropDownList ID="ddlSortable_length" size="1" aria-controls="tSortable" runat="server"
                                        OnSelectedIndexChanged="tSortable_length_SelectedIndexChanged" AutoPostBack="true">
                                        <asp:ListItem Value="5">5</asp:ListItem>
                                        <asp:ListItem Value="10">10</asp:ListItem>
                                        <asp:ListItem Value="25">25</asp:ListItem>
                                        <asp:ListItem Value="50" Selected="True">50</asp:ListItem>
                                        <asp:ListItem Value="100">100</asp:ListItem>
                                    </asp:DropDownList>
                                    entries</label>
                            </div>
                            <div>
                                <uc1:ucPaging ID="pagingtop" runat="server" />
                            </div>
                            <table width="100%" cellspacing="0" cellpadding="0" class="table" id="tbUsers">
                                <thead>
                                    <tr>
                                        <th style="width: 40px">
                                            No
                                        </th>
                                        <th>
                                            Staff Code
                                        </th>
                                        <th>
                                            Staff Name
                                        </th>
                                        <th>
                                            Address
                                        </th>
                                        <th>
                                            Level
                                        </th>
                                        <th>
                                            Staff Type
                                        </th>
                                        <th>
                                            Unit Name
                                        </th>
                                        <th style="width: 85px">
                                            Phone Number
                                        </th>
                                        <th style="text-align: center">
                                            Action
                                        </th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <asp:Repeater ID="rptStaff" runat="server" OnItemDataBound="rptStaff_ItemDataBound"
                                        OnItemCommand="rptStaff_ItemCommand">
                                        <ItemTemplate>
                                            <tr>
                                                <td style="text-align: center">
                                                    <%#(Container.ItemIndex +1)%>
                                                </td>
                                                <td>
                                                    <%#Eval("StaffCode")%>
                                                </td>
                                                <td>
                                                    <%#Eval("StaffName")%>
                                                </td>
                                                <td>
                                                    <%#Eval("Address")%>
                                                </td>
                                                <td>
                                                    <%#Eval("StaffLevel")%>
                                                </td>
                                                <td>
                                                    <%#Eval("StaffType")%>
                                                </td>
                                                <td>
                                                    <%#Eval("UnitName")%>
                                                </td>
                                                <td id="tdPhoneNumber" runat="server">
                                                    &nbsp;
                                                </td>
                                                <td style="text-align: center">
                                                    <asp:ImageButton ID="ibtnEdit" CommandName="Edit" CommandArgument='<%#Eval("StaffID")%>'
                                                        ToolTip="Edit Staff" ImageUrl="~/images/i_edit.gif" runat="server" />
                                                    &nbsp;&nbsp;&nbsp;
                                                    <asp:ImageButton ID="ibtnDelete" CommandName="Delete" CommandArgument='<%#Eval("StaffID")%>'
                                                        ToolTip="Delete Staff" ImageUrl="~/images/i_delete.gif" runat="server" OnClientClick="return confirm('Are you sure delete this staff?');" />
                                                </td>
                                            </tr>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </tbody>
                            </table>
                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdateProgress ID="udprogress" DisplayAfter="1" runat="server">
        <ProgressTemplate>
            <div class="ui-widget-overlay ui-front">
                <img src="images/loading.gif" alt="Loading..." style="position: fixed; top: 50%;
                    left: 50%" />
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <input type="hidden" id="formId" value="StaffManagement" />
</asp:Content>
